<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteRule .* - [E=MOD_REWRITE:1]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php [QSA,L]

    # Set REQUEST_SCHEME (standard environment variable in Apache 2.4)
    RewriteCond %{HTTPS} off
    RewriteRule .* - [E=REQUEST_SCHEME:http]

    RewriteCond %{HTTPS} on
    RewriteRule .* - [E=REQUEST_SCHEME:https]
</IfModule>

DirectoryIndex index.php
